<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
    <script type="text/javascript">
        function load(){

            var xPoint=window.event.clientX;
            var yPoint=window.event.clientY;
            div2.innerHTML="X="+xPoint+",Y="+yPoint;
            div2.style.marginLeft=xPoint+"px";
            div2.style.marginTop=yPoint+"px";
            div1.onmousemove=dOnmousemove;
        }
        function dOnmousemove(){
            var div=document.getElementById("div1");
            var xPoint=window.event.clientX;
            var yPoint=window.event.clientY;
            div2.innerHTML="X="+xPoint+",Y="+yPoint;
            div2.style.marginLeft=xPoint+"px";
            div2.style.marginTop=yPoint+"px";


        }
        document.onmousemove=load;


    </script>
</head>
<body onload="load()"style="background-color:Red">
<div id="div1" style="width:100%;height:100%" >
    <div id="div2" style=" background-color:Yellow; width:100px;height:20px;">ddd</div>
</div>


</body>
</html>